//
//  ViewController.m
//  12-StoryBoardQQPlayPage
//
//  Created by 曹曹 on 16/7/30.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *songImageView;
@property (weak, nonatomic) IBOutlet UIImageView *songImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    CGFloat imageViewWidth = [UIScreen mainScreen].bounds.size.height / 5;
//    _songImageView.layer.cornerRadius = imageViewWidth;
//    _songImage.layer.cornerRadius = imageViewWidth * 19 / 20;
//    _songImage.layer.masksToBounds = YES;
//    _songImageView.layer.masksToBounds = YES;
    
    UIGraphicsBeginImageContextWithOptions(_songImageView.bounds.size, NO, 1.0);
    [[UIBezierPath bezierPathWithRoundedRect:_songImageView.bounds cornerRadius:_songImageView.frame.size.width] addClip];
    [_songImageView drawRect:_songImageView.bounds];
    _songImageView.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIGraphicsBeginImageContextWithOptions(_songImage.bounds.size, NO, 1.0);
    [[UIBezierPath bezierPathWithRoundedRect:_songImage.bounds cornerRadius:_songImage.frame.size.width] addClip];
    [_songImage drawRect:_songImage.bounds];
    _songImage.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
